import Vue from 'vue'
import Router from 'vue-router'
import createSurvey from '../views/createsurvey/index.vue'

import login from '../views/login/login.vue'
import register from '../views/login/register.vue'
import home from '../views/index.vue'
import queryAll from "../views/querysurvey/querysurvey.vue"
import topbar from '../components/topbar.vue'
import sidebar from '../components/sidebar.vue'
import copy from '../../copy/createsurvey/index.vue'

import answer from '../views/answersurvey/answer.vue'
import editsurvey from '../views/editsurvey/editsurvey.vue'
import queryRelease from '../views/querysurvey/queryRelease.vue'
import queryNotRelease from '../views/querysurvey//queryNotRelease.vue'
import feedbackPage from '../views/feedbackPage/page.vue'
import tablePage from '../views/tablePage/tablePage.vue'
import okanswer from '../views/feedbackPage/okanswer.vue'
import okcreate from '../views/feedbackPage/okcreate.vue'

// import optiona from '../views/editsurvey/options/singlechoice.vue'
// import optionb from '../views/editsurvey/options/multichoice.vue'
// import optionc from '../views/editsurvey/options/inputbox.vue'





Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/register',
      name: 'register',
      component: register
    },
    {
      path: '/createsurvey',
      name: 'createSurvey',
      component: createSurvey
    },
    {
      path: '/home',
      redirect: '/home/queryall',
      name: 'home',
      component: home,
      children:[
        {
          path:'create',
          component:createSurvey
        },{
          path:'queryall',
          component:queryAll
      },{
          path:'queryRelease',
          component:queryRelease
      },{
        path:'queryNotRelease',
        component:queryNotRelease
    },{
      path:'edit',
      component:editsurvey
    },{
      path:'feedbackPage/:surId',
      component:feedbackPage
    },{
      path:'tablepage/:surId',
      component:tablePage
    },{
      path:'okcreate',
      component:okcreate
    }]
    },
    {
      path: '/answer/:surId',
      component:answer
    },
    {
      path: '/okanswer',
      component:okanswer
    },
    //  {
    //   path: '/optiona',
    //   name: 'optiona',
    //   component: optiona
    // },
    // {
    //   path: '/optionb',
    //   component: optionb
    // },
    // {
    //   path: '/optionc',
    //   component: optionc
    // },
    {
      path: '/topbar',
      name: 'topbar',
      component: topbar
    },
    {
      path: '/sidebar',
      name: 'sidebar',
      component: sidebar
    },
    {
      path: '/copy',
      name: 'copy',
      component: copy
    }
  ],
    mode: 'history'
})
